package com.anolesoft.yr.mbus.prod.model.mapper;

import com.anolesoft.yr.mbus.prod.model.dto.*;
import com.anolesoft.yr.mbus.prod.model.sql.ProdServiceValueSQL;
import com.anolesoft.yr.mbus.prod.model.vo.ProdServiceValueQueryVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProdServiceValueMapper {

    //根据主键查询产品服务项参数数据
    @Select(ProdServiceValueSQL.QUERY_PROD_SERVICE_VALUE_BY_UID)
    @Results(id = "queryProdServiceValueByUid", value = {
            @Result(column = "objuid", property = "objuid"),
            @Result(column = "value", property = "updateValue"),
            @Result(column = "is_default", property = "updateIsDefault"),
            @Result(column = "is_holiday", property = "updateIsHoliday"),
            @Result(column = "accept_time", property = "updateAcceptTime"),
            @Result(column = "reply_time", property = "updateReplyTime"),
            @Result(column = "delivery_time", property = "updateDeliveryTime"),
            @Result(column = "arrival_time", property = "updateArrivalTime"),
            @Result(column = "remark", property = "updateRemark")
    })
    List<ProdServiceValueQueryVO> queryProdServiceValueByUid(String uid);

    //删除产品服务项参数信息
    @Update(ProdServiceValueSQL.DELETE_PROD_SERVICE_VALUE)
    int deleteServiceValue(String objuid);

    //删除产品服务项参数信息
    @Update(ProdServiceValueSQL.DELETE_PROD_SERVICE_VALUE2)
    int deleteServiceValue2(ProdServiceValueDeleteDTO ProdServiceValueDeleteDTO);

    //删除产品服务项参数信息
    @Update(ProdServiceValueSQL.DELETE_PROD_SERVICE_VALUE3)
    int deleteServiceValue3 (@Param("prodProductionUid") String prodProductionUid, @Param( "prodServiceDeleteDTOList" ) List<ProdServiceDeleteDTO>  prodServiceDeleteDTOList);

    //新增服务项参数信息表
    @Insert(ProdServiceValueSQL.SAVE_PROD_SERVICE_VALUE)
    int saveProdServiceValue(ProdServiceValueSaveDTO prodServiceValueSaveDTO);

    //根据主键查询产品服务项参数名称
    @Select(ProdServiceValueSQL.QUERY_PROD_SERVICE_VALUE_BY_UID2)
    @Results(id = "queryProdServiceValueByUid2", value = {
            @Result(column = "objuid", property = "value"),
            @Result(column = "value", property = "text")
    })
    List<ProdServiceValueQueryVO> queryProdServiceValueByUid2(String uid);

    //根据主键查询产品服务项参数数据
    @Select(ProdServiceValueSQL.QUERY_PROD_SERVICE_VALUE_BY_UID3)
    @Results(id = "queryProdServiceValueByUid3", value = {
            @Result(column = "objuid", property = "objuid"),
            @Result(column = "value", property = "updateValue"),
            @Result(column = "is_default", property = "updateIsDefault"),
            @Result(column = "is_holiday", property = "updateIsHoliday"),
            @Result(column = "accept_time", property = "updateAcceptTime"),
            @Result(column = "reply_time", property = "updateReplyTime"),
            @Result(column = "delivery_time", property = "updateDeliveryTime"),
            @Result(column = "arrival_time", property = "updateArrivalTime"),
            @Result(column = "remark", property = "updateRemark")
    })
    ProdServiceValueQueryVO queryProdServiceValueByUid3(String uid);

    //根据主键查询产品服务项参数数据
    @Select(ProdServiceValueSQL.QUERY_PROD_SERVICE_VALUE_BY_UID4)
    @Results(id = "queryProdServiceValueByUid4", value = {
            @Result(column = "objuid", property = "objuid"),
            @Result(column = "value", property = "updateValue"),
            @Result(column = "is_default", property = "updateIsDefault"),
            @Result(column = "is_holiday", property = "updateIsHoliday"),
            @Result(column = "accept_time", property = "updateAcceptTime"),
            @Result(column = "reply_time", property = "updateReplyTime"),
            @Result(column = "delivery_time", property = "updateDeliveryTime"),
            @Result(column = "arrival_time", property = "updateArrivalTime"),
            @Result(column = "remark", property = "updateRemark")
    })
    ProdServiceValueQueryVO queryProdServiceValueByUid4(String uid);

    //查询服务项参数
    @Select(ProdServiceValueSQL.QUERY_PROD_SERVICE_VALUE)
    @Results(id = "queryProdServiceValue2", value = {
            @Result(column = "objuid", property = "objuid"),
            @Result(column = "value", property = "value")
    })
    List<ProdServiceValueQueryVO> queryProdServiceValue2(String serviceName);

    //查询询盘回访服务报价单中服务级别
    @Select(ProdServiceValueSQL.QUERY_PROD_SERVICE_VALUE3)
    @Results(id = "queryProdServiceValue3", value = {
            @Result(column = "objuid", property = "objuid"),
            @Result(column = "value", property = "value")
    })
    List<ProdServiceValueQueryVO> queryProdServiceValue3();

}
